ProjectName.modules.BannerListing = {
    init: function () {
        this.selectAllCheckbox();
        this.deleteSelector();
        this.searchSelector();
        this.tableSortor();
    } ,
    tableSortor: function () {
        jQuery("#bannerlisting-table").tablesorter({
            headers: {
                0: {
                    sorter: false
                },
                2: {
                    sorter: false
                },
                3: {
                    sorter: false
                },
                4: {
                    sorter: false
                }
            }
        });
    },
    selectAllCheckbox: function () {
        $('#selectall').click(function(){
            if ($(this).is(':checked') == true) {
                $('.content-checkbox').attr('checked', true);
            } else {
                $('.content-checkbox').attr('checked', false);
            }
        });
    },
    deleteSelector : function () {
        $('#show_all_button').click(function(){
            $('#searchtype').val('');
            $('#searchtext').val('');
            $('#search-category').val('');
        });
        
        $('#multiaction').change(function(){
            $('#searchtype').val('');
            $('#searchtext').val('');
            $('#search-category').val('');
        });
    },
    searchSelector : function () {
        $('#searchtext-container').show();
        $('#searchtype').change(function(){
            $('#multiaction').val('');
            $('.search-type').hide();
            var searchtype = jQuery.trim($(this).val());
            if (searchtype == 'title') {
                $('#searchtext-container').show();
                $('#search-category').val('');
            } else if (searchtype == 'category') {
                $('#searchtext').val('');
                $('#category-container').show();
            }
            else {
                $('#searchtext-container').show();
                $('#search-category').val('');
            }
        });
        $('#searchtype').trigger('change');
    }
}
